package cn.virens.common.boot.dubbo.consumer.beetl.fun;

import org.beetl.core.Context;
import org.beetl.core.Function;
import org.dromara.hutool.core.text.StrUtil;

public class FormSelectFunction implements Function {
    private static final String YES = "selected";
    private static final String NO = "";

    @Override
    public String call(Object[] paras, Context ctx) {
        if (paras == null || paras.length < 2) return NO;

        // 判断2个值是否一样
        String val0 = String.valueOf(paras[0]);
        String val1 = String.valueOf(paras[1]);
        if (StrUtil.equals(val0, val1)) {
            return YES;
        } else {
            return NO;
        }
    }

}
